package com.isoft.c2team3service2.controller;

import com.isoft.c2team3service2.common.Result;
import com.isoft.c2team3service2.entity.ConcertDetailDTO;
import com.isoft.c2team3service2.entity.ConcertsDTO;
import com.isoft.c2team3service2.entity.MainConcerts;
import com.isoft.c2team3service2.service.MainConcertsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 蓝莓
 * @since 2025-09-12
 */
@RestController
@RequestMapping("/main_concerts")
public class MainConcertsController {

    @Autowired
    private MainConcertsService mainConcertsService;

    //查询所有艺人的巡演
    @GetMapping("/getInformation")
    public Result<List<MainConcerts>> getInformation() {
        return Result.success(mainConcertsService.getInformation());
    }

    //利用条件查询
    @GetMapping("/search")
    public Result<List<ConcertDetailDTO>> search(ConcertsDTO concertsDTO) {
        return Result.success(mainConcertsService.search(concertsDTO));
    }

}
